﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using NIKE_Project.BLL;
using NIKE_Project.Model;

namespace NIKE_ProjectTests.KZJ
{
    [TestClass]
    public class UnitTestRegisterServer
    {
        private readonly RegisterServer Server = new RegisterServer();
        /// <summary>
        /// 测试验证用户
        /// </summary>
        [TestMethod]
        public void TestValidateUser()
        {
            var ds=Server.ValidateUser("15889849679", "123456");
            var rowCount = ds.Tables["nike"].Rows.Count;
            Assert.AreEqual(1, rowCount);
        }
        /// <summary>
        /// 测试注册店长
        /// </summary>
        [TestMethod]
        public void TestRegisterUser()
        {
            var model = new RegisterModel()
            {
                SalesmanID =4.ToString(),
                SalesmanName = "amadeus",
                Mobile = "19889849679",
                Pwd ="123456",
                Pwd1 = "123456",
                Role = "店长",
                BaseSalary = "3242.55",
                CommissionRate = "0.11",
                Gender =  "男"
            };
            var count = Server.RegisterUser(model);
            Assert.AreEqual(1, count);
        }
    }
}
